import numpy as np
import math

def correctA1(A1, delta_f):
    _lambda = np.matmul(np.linalg.inv(np.matmul(A1,A1.T)), np.matmul(A1, delta_f.reshape(len(delta_f),1)))
    _correctIndex = np.array(np.where(_lambda >= 0))[0]
    return A1[_correctIndex]


A1=np.array([[1,2,3,4,5],
           [6,4,5,8,6],
           [8,5,2,4,6],
           [-1,2,-8,5,7],
           [5,-1,8,2,0]])
delta_f=np.array([-1,2,-3,-4,-5])
print(correctA1(A1, delta_f))
T=np.array([[1,2,3],[5,6,4],[0,0,-1]])
print(np.all(T>=0))
print(np.inf)
print(math.inf)